package offer;

public class Solution11 {
    public int minArray(int[] numbers) {
        int l = 0, r = numbers.length - 1;
        while (l < r) {
            int m = l + (r - l) / 2;
            if (numbers[l] == numbers[r] && numbers[m] == numbers[l]) {
                l++;
                r--;
            } else if (numbers[m] <= numbers[r]) {
                r = m;
            } else {
                l = m + 1;
            }
        }
        return numbers[l];
    }
}